package io.shuttle.mbe.api.types

interface Window
interface MediaStream
interface SubtleCrypto
interface Blob
interface DirectoryEntry

data class ImageData(
    var data: ArrayBuffer,
    var height: ULong,
    var width: ULong
)



class ArrayBuffer {
    constructor(size: Int) {
        data = ArrayList(size)
    }

    constructor(buf: List<Int>?) {
        data = buf
    }

    var data: List<Int>?
    var sizeCopied: Int = 0 // Out parameter

    val byteLength: Int
        get() = sizeCopied
    val resizable: Boolean
        get() = false

    companion object {
        fun isView(): Boolean {
            // FIXME:
            return false
        }
    }
}

class CharArrayBuffer {
    constructor(size: Int) {
        data = ArrayList<Char>(size)
    }

    constructor(buf: List<Char>?) {
        data = buf
    }

    var data: List<Char>? // In and out parameter
    var sizeCopied: Int = 0 // Out parameter
}

